# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=redeye
pkgver=0.9.4
pkgrel=1
pkgdesc='Visual analytic tool supporting Red & Blue Team operations.'
arch=('x86_64')
groups=('blackarch' 'blackarch-misc')
url='https://github.com/cisagov/RedEye'
license=('BSD-3')
depends=()
makedepends=()
options=('!strip')
source=("https://github.com/cisagov/RedEye/releases/download/v$pkgver/RedEye-linux.zip")
sha512sums=('94f7136384a10bda52945d7a014f003c1fb4a69a968ec27ffbbae598891856c91136cc13bee8ec73069194def1b1a07522ebe0525bfeadfccaa22cabcb7501c1')

package() {
  cd RedEye-linux

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -rf parsers "$pkgdir/usr/share/$pkgname/"
  install -Dm 755 RedEye "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./RedEye "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

